namespace SeataNet.Core.Common
{
    /// <summary>
    /// 分支事务状态枚举
    /// </summary>
    public enum BranchStatus
    {
        /// <summary>
        /// 未知状态
        /// </summary>
        Unknown,

        /// <summary>
        /// 已注册
        /// </summary>
        Registered,

        /// <summary>
        /// PhaseOne已完成
        /// </summary>
        PhaseOneDone,

        /// <summary>
        /// PhaseOne失败
        /// </summary>
        PhaseOneFailed,

        /// <summary>
        /// PhaseTwo已提交
        /// </summary>
        PhaseTwoCommitted,

        /// <summary>
        /// PhaseTwo提交失败（可重试）
        /// </summary>
        PhaseTwoCommitFailedRetryable,

        /// <summary>
        /// PhaseTwo提交失败（不可重试）
        /// </summary>
        PhaseTwoCommitFailedUnretryable,

        /// <summary>
        /// PhaseTwo已回滚
        /// </summary>
        PhaseTwoRollbacked,

        /// <summary>
        /// PhaseTwo回滚失败（可重试）
        /// </summary>
        PhaseTwoRollbackFailedRetryable,

        /// <summary>
        /// PhaseTwo回滚失败（不可重试）
        /// </summary>
        PhaseTwoRollbackFailedUnretryable,

        /// <summary>
        /// 已提交
        /// </summary>
        Committed,

        /// <summary>
        /// 已回滚
        /// </summary>
        RolledBack,

        /// <summary>
        /// 失败
        /// </summary>
        Failed
    }
}